package com.antu.first.enums;

/**
 * Created by Administrator on 2018/3/7.
 */
public enum MerchantStateEnum {

    ERROR_HOTEL_ID(-1,"该酒店不是您旗下的酒店！"),
    NOT_ROOT_MANAGER(-101,"只有ROOT管理员才能添加管理员"),
    INNER_ERROR(-001,"添加管理员失败！"),
    HAS_EXISTS(-002,"该用户名已存在"),
    SUCCESS(0,"操作成功"),
    EXPORT_EXCEPTION(-003,"执行过程出现异常"),
    ERROR(-110,"操作失败"),
    CAN_NOT_DEL(-103,"ROOT管理员不能删除自己！"),
    CAN_NOT_DELE(-104,"只有ROOT管理员可以执行删除操作"),
    EMPTY_LIST(-105,"暂时没有查询到相应信息！");

    private int state;

    private String stateInfo;

    MerchantStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {

        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public static MerchantStateEnum valueOf(int key){
        for(MerchantStateEnum stateEnum:values()){
            if(stateEnum.getState() == key){
                return stateEnum;
            }
        }
        return null;
    }
}
